import Types from '@/components/CustomPage/workflow/common/types'
import {
  Slider,
  Color,
  Input,
  UploadImage, Extend, Area, Select
} from '@/components/CustomPage/fields/widget'
import { DataOption } from './dataops'
import { BasicOption } from './basicops'
import rankListComp from '../widget/rank/rankListComp'
import scoreRankStyleOneComp from '../widget/rank/scoreRankStyleOneComp'
import scoreRankStyleTwoComp from '../widget/rank/scoreRankStyleTwoComp'
import { labelOptions } from './labelOps'
export default {
  // 排行榜组件
  rankListComp() {
    return {
      target: rankListComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '积分排行榜',
        value: ''
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'paddingLeftRight',
                value: 0,
                max: 50,
                step: 1
              }
            },
            {
              type: Input,
              option: {
                label: '第一行数据背景色',
                value: '#fff',
                name: 'firstBackgroundColor'
              }
            },
            {
              type: Input,
              option: {
                label: '第二行数据背景色',
                value: '#fff',
                name: 'secondBackgroundColor'
              }
            },
            {
              type: Input,
              option: {
                label: '第三行数据背景色',
                value: '#fff',
                name: 'threeBackgroundColor'
              }
            },
            ...labelOptions(),
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
  // 分数排行榜
  scoreRankStyleOneComp() {
    return {
      target: scoreRankStyleOneComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '分数排行榜2',
        value: ''
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // {
            //   type: Input,
            //   option: { label: '组件名称', name: 'label', required: true,disabled:true }
            // },
            /* {
              type: Slider,
              option: {
                label: '上间距',
                name: 'newTop',
                value: -30,
                max: 50,
                min: -50,
                step: 1
              }
            },*/
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'rankPaddingLeftRight',
                value: 10,
                min: 0,
                max: 50,
                step: 1
              }
            },
            // {
            //   type: Extend,
            //   option: {
            //     label: '活动标签',
            //     name: 'ActivityLabel',
            //     initalize: true,
            //     fields: [
            //       {
            //         type: Area,
            //         option: {
            //           label: '选择标签分类',
            //           required: true,
            //           name: 'type',
            //           value: '',
            //           async: '/backend/sysClassify/getClassifyTree',
            //           asyncParams: {
            //             classifyType: 'FLLX_BQ',
            //             status: 'ZT01',
            //             t: new Date().getTime()
            //           },
            //           props: {
            //             children: 'children',
            //             label: 'classifyName',
            //             value: 'code',
            //             checkStrictly: true
            //           }
            //         }
            //       },
            //       {
            //         type: Select,
            //         option: {
            //           name: 'position',
            //           label: '标签位置',
            //           list: [
            //             {
            //               name: '默认',
            //               value: 'default'
            //             },
            //             {
            //               name: '左上',
            //               value: 'topLeft'
            //             },
            //             {
            //               name: '右上',
            //               value: 'topRight'
            //             },
            //             {
            //               name: '左下',
            //               value: 'bottomLeft'
            //             },
            //             {
            //               name: '右下',
            //               value: 'bottomRight'
            //             }
            //           ],
            //           value: ''
            //         }
            //       },
            //       { type: Input, option: { label: '标签标识', name: 'key' }}
            //     ]
            //   }
            // }
            ...labelOptions(),
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  },
   // 分数排行榜样式二
   scoreRankStyleTwoComp() {
    return {
      target: scoreRankStyleTwoComp,
      parameter: {
        relate: true,
        mold: 'field',
        label: '分数排行榜1',
        value: ''
      },
      option: [
        {
          title: '基础配置',
          fields: [
            ...BasicOption(),
            // {
            //   type: Input,
            //   option: { label: '组件名称', name: 'label', required: true,disabled:true }
            // },
            /* {
              type: Slider,
              option: {
                label: '上间距',
                name: 'newTop',
                value: -30,
                max: 50,
                min: -50,
                step: 1
              }
            },*/
            {
              type: Slider,
              option: {
                label: '左右间距',
                name: 'rankPaddingLeftRight',
                value: 10,
                min: 0,
                max: 50,
                step: 1
              }
            },
            ...labelOptions(),
          ]
        },
        ...DataOption()
      ],
      valueType: Types.VALUETYPES.CATEGORYCHANGE
    }
  }
}
